package com.igor.reporting.dao.solver;

import java.util.List;

import org.apache.tapestry5.ioc.annotations.Inject;
import org.hibernate.Session;

import com.igor.reporting.entities.solver.Solver;

public class SolverDAOImpl implements SolverDAO {

	@Inject
	private Session session;

	public void add(Solver s) {
		if (s != null) {
			session.save(s);
		}

	}

	public void delete(Solver s) {
		if (s != null) {
			session.delete(s);
		}

	}

	public void update(Solver s) {
		if (s != null) {
			session.update(s);
		}

	}

	public Solver find(Long id) {
		return (Solver) session.load(Solver.class, id);
	}

	public List<Solver> findAll() {
		return session.createCriteria(Solver.class).list();
	}

}
